From 43940acfcaccf4c159448e73830f2310962845e0 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Tue, 10 Aug 2004 13:53:32 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.32 (4118d35c609YWhxt_3C-hWCNhXozxA) migration integration with new xend --- tools/libxc/xc_linux_restore.c | 20 ++++++++++++++++++-- tools/python/xen/xend/XendDomain.py | 2 +- tools/python/xen/xend/XendDomainInfo.py | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/tools/libxc/xc_linux_restore.c b/tools/libxc/xc_linux_restore.c index db21621e55..304413b485 100644 --- a/tools/libxc/xc_linux_restore.c +++ b/tools/libxc/xc_linux_restore.c @@ -86,7 +86,7 @@ int xc_linux_restore(int xc_handle, XcIOContext *ioctxt) int rc = 1, i, n, k; unsigned long mfn, pfn, xpfn; unsigned int prev_pc, this_pc; - u32 dom = ioctxt->domain; + u32 dom = 0; int verify = 0; /* Number of page frames in use by this Linux session. */ @@ -143,7 +143,7 @@ int xc_linux_restore(int xc_handle, XcIOContext *ioctxt) return 1; } - /* Start writing out the saved-domain record. */ + /* Start reading the saved-domain record. */ if ( xcio_read(ioctxt, signature, 16) || (memcmp(signature, "LinuxGuestRecord", 16) != 0) ) { @@ -201,6 +201,7 @@ int xc_linux_restore(int xc_handle, XcIOContext *ioctxt) goto out; } +#if 0 /* Set the domain's name to that from the restore file */ if ( xc_domain_setname( xc_handle, dom, name ) ) { @@ -218,6 +219,21 @@ int xc_linux_restore(int xc_handle, XcIOContext *ioctxt) dom, nr_pfns,nr_pfns * (PAGE_SIZE / 1024)); goto out; } +#endif + + + /* XXX create domain on CPU=-1 so that in future it auto load ballances by default */ + if ( xc_domain_create( xc_handle, nr_pfns * (PAGE_SIZE / 1024), + name, + -1, &dom ) ) + { + xcio_error(ioctxt, "Could not create domain. pfns=%d, %dKB", + nr_pfns,nr_pfns * (PAGE_SIZE / 1024)); + goto out; + } + + ioctxt->domain = dom; + printf("Created domain %ld\n",dom); /* Get the domain's shared-info frame. */ op.cmd = DOM0_GETDOMAININFO; diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py index 7ae079734f..826d24a4fa 100644 --- a/tools/python/xen/xend/XendDomain.py +++ b/tools/python/xen/xend/XendDomain.py @@ -413,7 +413,7 @@ class XendDomain: def domain_exists(self, name): name = str(name) - return self.domain_by_name.get(name) or self.domain_by_id.get(name): + return self.domain_by_name.get(name) or self.domain_by_id.get(name) def domain_unpause(self, id): """Unpause domain execution. diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 056a171fc2..19f95856cb 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -473,7 +473,7 @@ class XendDomainInfo: # When creating or rebooting, a domain with my name should not exist. # When restoring, a domain with my name will exist, but it should have # my domain id. - if dominfo and (not self.dom or dominfo.dom != self.dom) + if dominfo and (not self.dom or dominfo.dom != self.dom): raise VmError('vm name clash: ' + name) def construct(self, config): -- 2.30.2